package com.springcloud.zuul.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.springcloud.zuul.common.validator.group.AddGroup;
import com.springcloud.zuul.common.validator.group.UpdateGroup;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @program: springcloud-zuul
 * @description: 产品
 * @author: zhlu
 * @create: 2019-12-31 14:00
 * @Introduction(说明背景故事)
 **/
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("sys_product")
public class SysProductEntity extends CommonEntity{

    /**
     * guid
     */
    @TableId
    private String guId;

    /**
     * 产品编号
     */
    private String productId;

    /**
     * 产品名称
     */
    private String productName;

    /**
     * 产品负责人
     */
    private String userId;

    /**
     * 产品负责人姓名
     */
    @TableField(exist = false)
    private String userName;

    /**
     * 产品描述
     */
    private String description;

    /**
     * 产品状态    状态 1 上架  0 下架
     */
    @NotNull(message = "产品状态不能为空！",groups = {AddGroup.class, UpdateGroup.class})
    @Min(value = 0,message = "产品状态不合理！",groups = {AddGroup.class, UpdateGroup.class})
    @Max(value = 1,message = "产品状态不合理！",groups = {AddGroup.class, UpdateGroup.class})
    private Integer estate;

    /**
     * 产品权限编码
     */
    @TableField(exist=false)
    private List<String> menuList;
}
